package structure_结构性.composite_pattern_组合模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/07/10:40
 * @Description:
 */
public class CompsitePatternDemo {
	public static void main(String[] args) {
		User zhangsan = new User("zhangsan", "ceo", 10000);
		User lisi = new User("lisi", "caiwu", 5000);
		User wangwu = new User("wangwu", "kaifajingli", 4000);

		User yuangong1 = new User("yuangong1", "caiwu", 5000);
		User yuangong2 = new User("yuangong2", "caiwu", 5000);

		User yuangong3 = new User("yuangong3", "kaifajingli", 5000);
		User yuangong4 = new User("yuangong4", "kaifajingli", 5000);

		zhangsan.add(lisi);
		zhangsan.add(wangwu);

		lisi.add(yuangong1);
		lisi.add(yuangong2);

		wangwu.add(yuangong3);
		wangwu.add(yuangong4);

		System.err.println(zhangsan);

		System.err.println(yuangong3);

		System.err.println(lisi);

	}
}
